﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace NewGame
{
    class Scene : VisibleGameEntity3D
    {
        private My3DModel _skyDom;
        private Map _map;

        public Map Map
        {
            get { return _map; }
            set { _map = value; }
        }

        public My3DModel SkyDom
        {
            get { return _skyDom; }
            set { _skyDom = value; }
        }

        public Scene(ContentManager content, string sceneName)
        {
            _skyDom = new My3DModel(content, @"Resources/Scene/" + sceneName + @"/Sky", 500, Vector3.Zero, 0);
            _map = new Map(content, @"Resources/Scene/" + sceneName + @"/Map/HeightMap", 1, new Vector3(0, 0, 0), 0, @"Resources/Scene/" + sceneName + @"/Map/MapInfo");
        }

        public override void Draw(GameTime gameTime, GraphicsDevice graphicsDevice, Effect effect, MyCamera camera)
        {
            _skyDom.Draw(gameTime, graphicsDevice, effect, camera);
            _map.Draw(gameTime, graphicsDevice, effect, camera);
        }

        public override void Update(GameTime gameTime)
        {
            _skyDom.Update(gameTime);
            _map.Update(gameTime);
        }
    }
}
